{__NOLAYOUT__}
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>羽毛球VIP后台登录</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <script src="__STATIC__/layui/layui.js" charset="utf-8"></script>
    <link rel="stylesheet" href="__STATIC__/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="__STATIC__/layui/css/login.css">
</head>

<body class="layui-layout-body">
    <div class="layadmin-user-login layadmin-user-display-show" id="LAY-user-login">

        <div class="layadmin-user-login-main">
            <div class="layadmin-user-login-box layadmin-user-login-header">
                <img style="width: 80px;margin-bottom: 10px;border-radius: 5px;" src="__STATIC__/images/logo.png">
                <h2>羽毛球VIP后台登录</h2>
                <p></p>
            </div>
            <div class="layadmin-user-login-box layadmin-user-login-body layui-form">
                <div class="layui-form-item">
                    <label class="layadmin-user-login-icon layui-icon layui-icon-username" for="LAY-user-login-username"></label>
                    <input type="text" name="username" id="LAY-user-login-username" lay-verify="required" placeholder="账户 、用户名 、 手机号"
                        class="layui-input">
                </div>
                <div class="layui-form-item">
                    <label class="layadmin-user-login-icon layui-icon layui-icon-password" for="LAY-user-login-password"></label>
                    <input type="password" name="password" id="LAY-user-login-password" lay-verify="required"
                        placeholder="密码" class="layui-input">
                </div>
                <div class="layui-form-item">
                    <button class="layui-btn layui-btn-fluid" lay-submit="" lay-filter="loginSubmit" id="login">登录</button>
                </div>
                <div class="layui-form-item" style="text-align: center">

                    <a href="javascript:;" class="qrcode" style="color: #999;">微信登录</a>
                </div>
            </div>
        </div>


    </div>
    <script>
        if(window.location.href.indexOf("index/login") == -1){
            window.location.href='/index/login'
        }
        
        layui.config({
            base: '__STATIC__/js/'
        })
        layui.use(['form', 'http'], function () {

            var $ = layui.$,
                form = layui.form;

            var http = layui.http;


            form.render();
            //提交
            form.on('submit(loginSubmit)', function (obj) {
                http.post('/index/login', obj.field, function (res) {
                    if (res.code == 0) { 
                        layer.msg('登录成功', {
                            offset: '15px',
                            icon: 1,
                            time: 300
                        }, function () {
                            window.location.href = res.data?res.data:'/index/index'
                        });
                    }
                }, $(this));
                return false
            });

            $('.qrcode').click(function () {
                layer.open({
                    type: 1,
                    content: '<img src="__STATIC__/images/qrcode.png"><p>请先绑定手机号</p>',
                    skin: 'layui-layer-admin',
                    title: false,
                    area: '323px',
                    shadeClose: true,
                });
            })

            $('body').keyup(function (event) {
                if (event.keyCode === 13) {
                    $("#login").click()
                    return false
                }
            });

        });
    </script>
</body>

</html>